<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : displayFbInfo.xsl
    Created on : November 19, 2013, 4:50 PM
    Author     : Liem
    Description:
        Purpose of transformation follows.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:f="http://xml.netbeans.org/schema/facebook" exclude-result-prefixes="f"
version="1.0">
    <xsl:output method="html"/>
    <!-- TODO customize transformation rules 
         syntax recommendation http://www.w3.org/TR/xslt 
    -->
    <xsl:template match="/">
        <div class="row-fluid">
            <h4>About:</h4>
            <xsl:value-of select="//f:pageAbout"/>
            <h4>Like(s): 
            <xsl:value-of select="//f:likeCount"/></h4>
            <h4>Post(s):
            <xsl:value-of select="//f:totalPost"/></h4>
            <h4>Comment(s):
            <xsl:value-of select="//f:totalComment"/></h4>
        </div>
        <table class="table responsive">
            <thead>
                <tr>
                    <th>#</th>
                    <th>Name</th>
                    <th>Comment(s)</th>
                </tr>
            </thead>
            <tbody>                          
                <xsl:for-each select="//f:Commenter">
                    <xsl:sort select="f:commentCount" order="descending" data-type="number"/>  
                    <tr>
                        <td>
                            <xsl:value-of select="position()"/>
                        </td>
                        <td>
                            <xsl:value-of select="f:commenterName"/>
                        </td>
                        <td>
                            <xsl:value-of select="f:commentCount"/>
                        </td>
                    </tr>
                </xsl:for-each>
            </tbody>
        </table>
    </xsl:template>

</xsl:stylesheet>
